<?php 
$data['page_selected'] = 'query';
$this->load->view('constants/header', $data);?>

<div id="site_content">
	<?php $this->load->view('constants/sidebar'); ?> 
    <div id="content">
        <!-- insert the page content here -->
	    <?php $this->load->view('query/menu'); ?>
        <br /><br /><br /><br />
  		<h3 align="center">Integrante</h3>        
        <table width="100%">
        	<tr>
             	<td align="center">
                    <form method="post" action="<?php echo base_url(); ?>query/search_user">
                        Buscar&nbsp;
                        <select name="type" id="type">
                            <option value="nombre">Nombre</option>
                            <option value="apellido">Apellido</option>
                            <option value="ci_integrante">C&eacute;dula</option>
                        </select>
                        &nbsp;
                        <input type="text" name="text" id="text">
                        <input type="image" alt="Submit" src="<?php echo base_url().IMG; ?>search_2.png" width="20px" height="20px" title="Buscar">
                    </form>
		        </td>
        	</tr>
        </table>
        
        <h1>Integrante: <?php echo $user['nombre'].' '.$user['apellido']; ?></h1>
        
        <?php if((count($activities) == 0) && (count($buddy_activities) == 0)) {?>
					El integrante no posee actividades registradas.
        <?php } 
		else{?>
            <table width="100%">
                <thead>
                    <th align="center"> Buddy </td>
                    <th align="center"> Buddy Univ./Col.</td>
                    <th align="center"> &#191Contacto Semanal? <br /> &#191Por qu&eacute; medio?</td>
                    <th align="center"> &#191Actividades junt@s? <br /> &#191D&oacute;nde y cu&aacute;ndo?</td>
                    <th align="center"> Observaciones</td>
                </thead>
                <?php foreach($activities as $r){ ?>
                    <tr>
                        <td width="10.2%" align="center" class="tdBorder">
                            <?php echo $r['BUDDY']['nombre'].' '.$r['BUDDY']['apellido']; ?>
                        </td>
                        <td width="10.2%" align="center" class="tdBorder">
                            <?php echo $r['nombre'].' '.$r['apellido']; ?>
                        </td>
                        <td width="15%" align="center" class="tdBorder">
                            <?php echo $r['medio_actividad']; ?>
                        </td>
                        <td width="19%" class="tdBorder">
                            Lugar: <?php echo $r['lugar_actividad']; ?><br />
                            Durante la semana del: <?php echo format_date($r['fecha_inicio_de_semana']); ?>
                        </td>
                        <td width="25.2%" class="tdBorder">
                            <?php echo $r['descripcion_actividad']; ?>
                        </td>
                    </tr>
                <?php } ?>
                <?php foreach($buddy_activities as $r){ ?>
                    <tr>
                        <td width="10.2%" align="center" class="tdBorder">
                            <?php echo $user['nombre'].' '.$user['apellido']; ?>
                        </td>
                        <td width="10.2%" align="center" class="tdBorder">
                            <?php echo $r['nombre'].' '.$r['apellido']; ?>
                        </td>
                        <td width="15%" align="center" class="tdBorder">
                            <?php echo $r['medio_actividad']; ?>
                        </td>
                        <td width="19%" class="tdBorder">
                            Lugar: <?php echo $r['lugar_actividad']; ?><br />
                            Durante la semana del: <?php echo format_date($r['fecha_inicio_de_semana']); ?>
                        </td>
                        <td width="25.2%" class="tdBorder">
                            <?php echo $r['descripcion_actividad']; ?>
                        </td>
                    </tr>
                <?php } ?>
            </table>
        <?php } ?>       
    </div>
</div>
<?php $this->load->view('constants/footer'); ?>